﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common;
using Wix.Aura.Common.CustomTypes;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class ComponentSearchSerialization : ComplianceCheckChildren {
		[Test]
		public void ComponentSearchIdParameter() {
			string expected = string.Format(baseXml, @"<ComponentSearch Id=""compIdentifier"" />");
			check.ComponentSearch.Add(new ComponentSearch("compIdentifier"));
			Assertion(expected, project);
		}

		[Test]
		public void ComponentSearchAllAttributes() {
			Guid id = Guid.NewGuid();
			string expected = string.Format(baseXml, string.Format(@"<ComponentSearch Id=""compIdentifier"" Guid=""{0}"" Type=""directory"" />", id.ToString().ToUpper()));
			check.ComponentSearch.Add(new ComponentSearch("compIdentifier") { Guid = id, SearchType = SearchType.Directory });
			Assertion(expected, project);
		}
	}
}
